using System.Collections.Generic;
using Microsoft.MediaCenter.Hosting;
using System.Threading;

namespace Playkanaler
{
    public class MyAddIn : IAddInModule, IAddInEntryPoint
    {
        private static HistoryPlusPageSession s_session;

        public void Initialize(Dictionary<string, object> appInfo, Dictionary<string, object> entryPointInfo)
        {
            ScreenSaver.Disable();
        }

        public void Uninitialize()
        {
            
            ScreenSaver.Enable();
        }

        public void Launch(AddInHost host)
        {
            s_session = new HistoryPlusPageSession();
            s_session.GoToPageWithoutHistory("resx://Playkanaler/Playkanaler.Resources/Default", null, null);
        }
        private class HistoryPlusPageSession : HistoryOrientedPageSession
        {
            public void GoToPageWithoutHistory(
                string source, IDictionary<string, object> sourceData, IDictionary<string, object> uiProperties)
            {
                LoadPage(source, sourceData, uiProperties);
            }
        }
    }
}